<?php
	require '../../include/library.inc.php';
	require '../../include/admin_login.inc.php';
	
	$page_id = intval($_GET['page_id']);
	
	if($page_id) {
	  
		$sql = "DELETE FROM 
				   pages
				WHERE
				   page_id = '$page_id'
				 ";
		query($sql);
		
		$sql = "DELETE FROM 
				   page_description
				WHERE
				   page_id = '$page_id'
				 ";
		query($sql);
		
		$sql = "DELETE FROM 
				   sef_url
				WHERE
				   query = '$page_id'
				   AND
				   tamplate = 'page'
				 ";
		query($sql);
					
		$_SESSION['message'] = 'Страницата е изтрита успешно!';
	
	}
  
	redirect($_SERVER['HTTP_REFERER']);
 
?>